from django.http import HttpResponse, FileResponse
from django.shortcuts import render

# Create your views here.
def test(request):
    from django.urls import reverse
    # url = reverse("x2:v1")  # /auth/
    # print(url)
    print("测试提交test")
    return HttpResponse("测试提交test")

def index(request):
    context={
        "name":"789",
        "phone":"18888888888"
    }
    print("测试网页")
    return render(request, 'index.html', context)
def nid(request,nid):
    return HttpResponse("输入的是"+nid)

def login(request):
    # 获取当前的方法路径
    path = request.resolver_match.url_name
    context={
        "name":"789",
        "phone":"18888888888"
    }
    # 获取当前方法的完整路径
    from django.urls import reverse
    url = reverse("login")
    print("测试网页")

    context['path']=url

    return render(request, 'index2.html', context)











def media(request):
    # 准备用来做视频播放 但是失败了

    return render(request, 'index3.html')

